package com.realdolmen.jcc.mobileSquad.dao
{
	import com.realdolmen.jcc.mobileSquad.domain.Customer;
	
	import mx.collections.ArrayCollection;

	/**
	 * Data access object interface for managing Customers.
	 * @author DOMSIEBE
	 */
	public interface CustomerDao{
		/**
		 * Populate with dummy data.
		 */		
		function populate():void;
		
		/**
		 * Save a Customer.
		 * @param customer The customer to save.
		 */		
		function save(customer:Customer):void;
		
		/**
		 * Update a customer.
		 * @param customer The customer to update.
		 */		
		function update(customer:Customer):void;
		
		/**
		 * Remove a customer.
		 * @param customer The customer to remove.
		 */		
		function remove(customer:Customer):void;
		
		/**
		 * Find all customers.
		 * @return All the customers.
		 */		
		function findAll():ArrayCollection;
		
		/**
		 * Search for companies that match a portion of the company name. 
		 * Example: cor will result in a list with Corelio.
		 * @param companyName A part of the company name.
		 * @return All the customers that match the criteria.
		 */		
		function search(companyName:String):ArrayCollection;
	}
}